import React, { Suspense, lazy } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import './index.scss';
// import Home from '../views/Home';
// import Info from '../views/Info';
// import Test from '../views/Test';

const Home = lazy(() => import('../views/Home'));
const Info = lazy(() => import('../views/Info'));
const Test = lazy(() => import('../views/Test'));

const ComLoading = (
    <div className="com-loading">Loading...</div>
)
const BasicRoute = () => (
    <Router>
        <Suspense fallback={ComLoading}>
            <Switch>
                <Route exact path="/" component={Home} />
                <Route exact path="/info/:blogId" component={Info} />
                <Route exact path="/test" component={Test} />
            </Switch>
        </Suspense>
    </Router>
)


export default BasicRoute;